﻿using System;
using System.Collections.Generic;
using SqlParameter = System.Data.SqlClient.SqlParameter;
using SqlDbType = System.Data.SqlDbType;
using IDataReader = System.Data.IDataReader;

namespace GamePlusClassLibrary
{
    public class Categoria
    {
        public int? Idf_Categoria { get; set; }
        public string Des_Categoria { get; set; }

        public static List<Categoria> List()
        {
            List<Categoria> ls = new List<Categoria>();
            using (IDataReader iDr = DataAccessLayer.ExecuteReader(System.Data.CommandType.Text, "SELECT * FROM Categoria", null))
            {
                while (iDr.Read())
                {
                    Categoria obj = new Categoria();
                    obj.Idf_Categoria = int.Parse(iDr["Idf_Categoria"].ToString());
                    obj.Des_Categoria = iDr["Des_Categoria"].ToString();
                    ls.Add(obj);
                }
            }

            return ls;
        }
    }
}
